<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/6/11
 * Time: 15:08
 */

namespace app\admin\controller;


use app\common\controller\AdminBaseController;
use app\common\ext\IDb;
use app\common\ext\IRequest;

class UserAssure extends AdminBaseController{
    /**
     * @功能 获取用户保单信息列表
     * @开发者 yy
     */
    public function user_assure_list(){
        //接受参数
        $user_id = IRequest::get('user_id');
        $assure_money = IRequest::get('assure_money');

        //获取数据
        $where = null;
        if(!empty($user_id)) $where['user_id'] = $user_id;
        if(!empty($assure_money)) $where['assure_money'] = $assure_money;
        $user_assure_list = IDb::getInstance('asset_assure')->setDbWhere($where)->pag();

        //页面赋值
        $this->assign('user_id', $user_id);
        $this->assign('assure_money', $assure_money);
        $this->assign('user_assure_list', $user_assure_list);

        //页面显示
        return view();

    }

    /**
     * @功能 获取用户担保信息
     * @开发者 yy
     */
    public function user_assure_info(){
        //接受参数
        $user_assure_id = IRequest::get('user_assure_id', IRequest::NOT_EMPTY, '贷款编号不能为空');

        //获取详情信息
        $where = null;
        $where['user_assure_id'] = $user_assure_id;
        $user_assure_info = IDb::getInstance('asset_assure')->setDbWhere($where)->row();

        //设置layout
        $this->layout("layout_empty");

        //页面赋值
        $this->assign('user_assure_info', $user_assure_info);

        return view();


    }


}